From: Giovanni Campagna Date: Tue, 28 Jan 2014 22:41:13 +0000 (+0100) Subject: NetworkMenu: use the carrier state to the decide if wired should be shown X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2837 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c4aeaf7fe81c31abec5e0dcebbd1243e888efccd;p=gnome-shell.git NetworkMenu: use the carrier state to the decide if wired should be shown The design says "when a network cable is connected", not "When a network cable is connected and the link is up and we have an IP etc. etc." (which is what ACTIVATED would imply). https://bugzilla.gnome.org/show_bug.cgi?id=723570 --- diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 5c43ed3b5..1d6d7c564 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -432,16 +432,15 @@ const NMDeviceWired = new Lang.Class({ this.item.menu.addMenuItem(createSettingsAction(_("Wired Settings"), device)); }, - _isConnected: function() { - if (!this._device.active_connection) - return false; - - let state = this._device.active_connection.state; - return state >= NetworkManager.ActiveConnectionState.ACTIVATING; + _hasCarrier: function() { + if (this._device instanceof NMClient.DeviceEthernet) + return this._device.carrier; + else + return true; }, _sync: function() { - this.item.actor.visible = this._isConnected(); + this.item.actor.visible = this._hasCarrier(); this.parent(); },